package gui.applets;

import java.applet.Applet;
import java.awt.Checkbox;
import java.awt.CheckboxGroup;
import java.awt.Event;
import java.awt.TextField;

public class AppletRadio extends Applet {
	TextField tf = new TextField("Radio button 2", 30);
	CheckboxGroup g = new CheckboxGroup();
	Checkbox cb1 = new Checkbox("one", g, false);
	Checkbox cb2 = new Checkbox("two", g, false);
	Checkbox cb3 = new Checkbox("three", g, false);

	public void init() {
		tf.setEditable(false);
		add(tf);
		add(cb1);
		add(cb2);
		add(cb3);
	}

	public boolean action(Event evt, Object obj) {
		if (evt.target.equals(cb1)) {
			tf.setText("Radio Button 1");
		} else if (evt.target.equals(cb2)) {
			tf.setText("Radio Button 2");
		} else if (evt.target.equals(cb3)) {
			tf.setText("Radio Button 3");
		} else
			return super.action(evt, obj);
		return true;

	}
}
